<script lang="ts" setup>
import type { Course } from '@/request/types'

defineProps<{
  course: Course
}>()
</script>

<template>
  <router-link :to="`/course-learn/${course.currNo}`">
    <el-card>
      <el-image :src="course.iconPath" class="w-full h-[135px] rounded-md" fit="cover" />
      <div class="text-xl truncate">{{ course.name }}</div>
      <div class="text-sm leading-6">
        <div>简介：{{ course.currDesc }}</div>
        <div>
          上课时间：{{ new Date(course.startTeachingTime).toLocaleString().replaceAll('/', '-') }}
          ~
          {{ new Date(course.finishTeachingTime).toLocaleString().replaceAll('/', '-') }}
        </div>
      </div>
    </el-card>
  </router-link>
</template>

<style scoped></style>
